package fr.afcepf.ai89.esharing.data;

import java.util.List;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

import fr.afcepf.ai89.esharing.entity.Emprunt;
import fr.afcepf.ai89.esharing.entity.FrRegion;

@Stateless
public class DAOFrRegion implements IDAOFrRegion {

	@PersistenceContext(unitName = "ESharingPhase22")
	EntityManager em;

	@Override
	public FrRegion getFrRegion(int idFrRegion) {
		
		return null;
		
	}

	@Override
	public List<FrRegion> getFrRegions() {
		
		Query hql = em.createQuery("SELECT r from FrRegion r");

		List<FrRegion> regions = (List<FrRegion>)hql.getResultList();

		return regions;

	}

	@Override
	public int addFrRegion(FrRegion frReg) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int majFrRegion(FrRegion frReg) {
		// TODO Auto-generated method stub
		return 0;
	}

}
